package com.yz.dba.mapper;


import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;

/**
 * @author 段成
 * @date 2019/12/3 - 20:24
 */
@Mapper
@Component
public interface TaskCountMapper {
    @Select("select count from task_count where taskId=#{value}")
    int queryTaskCount(String taskId);

    @Delete("delete from task_count where taskId=#{value}")
    void delTaskCount(String taskId);

    @Insert("INSERT INTO task_count (`taskId`, `count`) VALUES (#{value}, 0)")
    void addTaskCount(String taskId);

    @Update("UPDATE task_count SET count=count + ${modifyValue} where taskId=#{taskId}")
    void updateThreadCount(@Param("taskId") String taskId, @Param("modifyValue") int modifyValue);
}
